
// 多条件分页查询
@Operation(description = "多条件查询课程带分页")
@PostMapping("/pageCourseCondition/{page}/{limit}")
public R pageCourseCondition(
    @Parameter(name = "page", description = "当前页码", required = true) @PathVariable Long page,
    @Parameter(name = "limit", description = "每页记录数", required = true) @PathVariable Long limit,
    @RequestBody(required = false) CourseQuery courseQuery) { // 通过封装courseQuery对象
    // 创建分页page对象
    Page<EduCourse> pageParam = new Page<>(page, limit);
    // 调用方法实现多条件分页查询
    eduCourseService.pageQuery(pageParam, courseQuery);
    // 获取查询到的数据
    List<EduCourse> records = pageParam.getRecords();
    // 获取总记录数
    long total = pageParam.getTotal();
    return R.ok().data("total", total).data("rows", records);
}
